package server;

/**
 * @author sxnan
 * @className HttpServlet
 * @description TODO
 * @date 2020/7/21
 */
public abstract class HttpServlet implements Servlet{

    public abstract void doGet(Request request, Response response);
    public abstract void doPost(Request request, Response response);

    @Override
    public void service(Request request, Response response) {
        String method = request.getMethod();
        if (method.equalsIgnoreCase("GET")){
            doGet(request,response);
        }else {
            doPost(request,response);
        }
    }
}
